new Vue({
  el: "#app",
  data() {
    return {
      lbtable: [],
      DomainIMG: "https://www.kdddy.cn/Image/",
      form: {
        Data: "group_rotation_pic",
      },
      total: 0,
      tableData: [], //表格数据
    };
  },
  mounted() {
    this.getList(this.form);
    this.lbt();
  },
  methods: {
    Remove(index, row) {
      console.log(row);
      row.Row_Status = "1";
      let lArray = new Array();
      lArray.push(row);
      let lJSONObject_group_rotation_pic = new Object();
      lJSONObject_group_rotation_pic.group_rotation_pic = lArray; //换表
      let lJSONObject_DataSet = new Object(); // Modify
      lJSONObject_DataSet.Modify = lJSONObject_group_rotation_pic; //换表
      console.log(lJSONObject_DataSet);
      const _this = this;
      $.ajax({
        // headers: requestHeaders(),
        // url: `${BASE_URL2}/generalBusiness/generalPaginationQueryBySQLSerialNumber`,
        url: "https://service.kdddy.cn/donghui/clientOperation/generalSaveForClient",
        type: "POST",
        data: {
          Data: JSON.stringify(lJSONObject_DataSet),
        },
        success: function (Result) {
          console.log(Result);
          if (Result.Status === "success") {
            _this.$message({
              message: "删除成功",
              type: "success",
            });
            window.history.go(-1);
          } else {
            _this.$message.error("删除失败，请稍后再试");
          }
        },
        complete: function (XMLHttpRequest) {
          requestPretreatment(XMLHttpRequest); //config/config.js 响应预检
        },
        dataType: "json",
      });
    },
    lbt() {
      const _this = this;
      $.ajax({
        type: "POST",
        // url: `${BASE_URL2}/generalBusiness/generalPaginationQueryBySQLSerialNumber`,
        url: "https://service.kdddy.cn/donghui/generalBusiness/generalQueryByTableNameWithOriginal",
        data: {
          Data: "group_rotation_pic", //表名
          Condition: "Row_Status='0'",
        },
        success: function (Result) {
          console.log(Result);
          _this.lbtable = Result;
          //   that.total = Result.TotalRows;
        },
        complete: function (XMLHttpRequest) {
          //   requestPretreatment(XMLHttpRequest);
        },
        dataType: "json",
      });
    },
    getList(data) {
      //换页方法
      const _this = this;
      $.ajax({
        type: "POST",
        // url: `${DomainName}/GoodsFileInquiry`,
        url: "https://service.kdddy.cn/donghui/generalBusiness/generalQueryByTableNameWithOriginal",
        data: {
          Data: "group_rotation_pic", //表名
          Condition: "Row_Status='0'",
        },
        // complete: function (XMLHttpRequest) {
        //   if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
        //     window.parent.document.location.href = '../../../'+XMLHttpRequest.getResponseHeader("CONTENTPATH");
        //   }
        // },
        success: function (Result) {
          console.log(Result);
          _this.tableData = Result;
        },
        dataType: "json",
      });
    },
    addContract() {
      window.location.href = "./Add.html";
    },
    bj() {
      window.location.href = "./index.html";
    },
  },
});
